<?php

namespace App\Model\BbcModel;

use Service\Code\Normal;
use App\Model\BaseModel\BaseBbcModel;

class MnStoreAdv extends BaseBbcModel {

    const DEFAULT_IMG_URL_1 = 'https://indoorbuydev.oss-cn-hangzhou.aliyuncs.com/new/upload/20220420/165042223278274.jpg';
    const DEFAULT_IMG_URL_2 = 'https://indoorbuydev.oss-cn-hangzhou.aliyuncs.com/new/upload/20220420/165042225979991.jpg';
    const DEFAULT_IMG_URL_3 = 'https://indoorbuydev.oss-cn-hangzhou.aliyuncs.com/new/upload/20220420/165042086577074.jpg';
    const DEFAULT_IMG_URL_4 = 'https://indoorbuydev.oss-cn-hangzhou.aliyuncs.com/new/upload/20220420/165042152095492.jpg';

    public $table = 'ly_mn_store_adv';

    /**
     * 默认的首页模板
     */
    public static function defaultTemplate($param) {
        if ($param['mnid'] == 2) { //小B
            $banner_img = [
                ['object_type' => 0, 'object_id' => 0, 'img_url' => self::DEFAULT_IMG_URL_1, 'object_status' => 0],
                ['object_type' => 0, 'object_id' => 0, 'img_url' => self::DEFAULT_IMG_URL_2, 'object_status' => 0]
            ];
        } else { //店铺
            $banner_img = [
                ['object_type' => 0, 'object_id' => 0, 'img_url' => self::DEFAULT_IMG_URL_3, 'object_status' => 0],
                ['object_type' => 0, 'object_id' => 0, 'img_url' => self::DEFAULT_IMG_URL_4, 'object_status' => 0]
            ];
        }
        $tab                           = ['banner_height' => 400, 'page_spacing' => 0, 'top_spacing' => 0, 'bottom_spacing' => 0, 'edges_type' => 1, 'img_lists' => $banner_img, 'tool' => []];
        $returnData['background_type'] = 1;
        $returnData['image']           = '';
        $returnData['bgcolor']         = '#F27180';
        $returnData['tabbgcolor']      = '#B77559';
        $returnData['is_goods_lists']  = 1;
        $returnData['is_class_nav']    = 1;
        $returnData['tab_lists']       = [['id' => 0, 'title' => '首页推荐页']];
        $returnData['tab']             = $tab;
        return Normal::returnCode(Normal::SUC, '默认模板', $returnData);
    }

}